package bud.vo;

import java.io.IOException;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.BinaryCodec;
import org.springframework.web.multipart.MultipartFile;

import lombok.Data;

@Data
public class ShopDTO {
	private Integer sh_no;
	private String sh_name;
	private String sh_phone;
	private String sh_add;
	private String sh_message;
	private MultipartFile sh_photo;
	private byte[] sh_photoStream;
	
	private double sh_latitude;
	private double sh_longitude;
	private String sh_pass;
	
	public void setSh_photo(MultipartFile sh_photo) throws IOException{
		this.sh_photo = sh_photo;
		sh_photoStream = Base64.encodeBase64(sh_photo.getBytes()) ;
	}
	
	public String getSh_photoStr(){
		return sh_photoStream==null?null:new String(sh_photoStream);
	}
}
